<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use DB;

class UserRole extends Model
{
    //
    protected $table = 'admin_role_users';


    public static  function getUserRole($uid){
       $users = DB::table('admin_role_users')
            ->leftjoin('admin_roles', 'admin_role_users.role_id', '=', 'admin_roles.id')
            ->select('admin_role_users.*')
            ->where('admin_role_users.user_id',$uid)
            ->get()
//			->toSql();
            ->toArray();
        if(!$users){
            return array();
        }
        return $users[0];
    }

}
